import { IParamModelPhotoResponse } from "@manycore/custom-miniapp-sdk";

/**
 * 获取指定模型的缩略图
 * @param modelImgData
 * @param id
 * @returns
 */
export const getImgDataById = (modelImgData: IParamModelPhotoResponse[], id: string) => {
  const modelData: IParamModelPhotoResponse | undefined = modelImgData.find(
    (m: IParamModelPhotoResponse) => m.modelId === id
  );
  if (modelData) {
    return (modelData as IParamModelPhotoResponse).imgData;
  }
  return;
};